# Maintainer: Alexey Minnekhanov <alexeymin@postmarketos.org>
pkgname=libapk-qt
pkgver=0.4.2
pkgrel=0
pkgdesc="Alpine Package Keeper (apk) Qt bindings"
url="https://gitlab.com/postmarketOS/libapk-qt"
arch="all"
license="GPL-2.0-only"
makedepends="apk-tools-dev cmake qt5-qtbase-dev"
source="https://gitlab.com/postmarketOS/libapk-qt/-/archive/v$pkgver/libapk-qt-v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-dbg"

builddir="$srcdir/libapk-qt-v$pkgver"

build() {
	cmake \
		-S . \
		-B build/ \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON
	make -C build
}

check() {
	make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="a9cc416cfd6e5ff12b47d9830aff1e54f8c931085727f378886d850eb196679f15459a19db8faf7387afbee43d0279a2ebc5a961d8e63bba04e971c29bdd4177  libapk-qt-v0.4.2.tar.gz"
